package com.infra.micro.id.domain.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

@ApiModel(value = "IdWorkerPO", description = "id_worker表实体对象")
public class IdWorkerPO implements Serializable {
    /**
     * INTEGER(10) 必填
     * 自增id
     */
    @ApiModelProperty(name = "workerId", value = "自增id")
    private Integer workerId;

    /**
     * VARCHAR(63) 默认值[] 必填
     * ip
     */
    @ApiModelProperty(name = "ip", value = "ip")
    private String ip;

    /**
     * INTEGER(10) 默认值[-1] 必填
     * port
     */
    @ApiModelProperty(name = "port", value = "port")
    private Integer port;

    /**
     * VARCHAR(127) 默认值[] 必填
     * ip:port
     */
    @ApiModelProperty(name = "localhost", value = "ip:port")
    private String localhost;

    /**
     * BIGINT(19) 默认值[0] 必填
     * 最后一次心跳时间戳
     */
    @ApiModelProperty(name = "maxTimestamp", value = "最后一次心跳时间戳")
    private Long maxTimestamp;

    /**
     * TIMESTAMP(19) 默认值[CURRENT_TIMESTAMP] 必填
     * 创建时间
     */
    @ApiModelProperty(name = "createTime", value = "创建时间")
    private Date createTime;

    /**
     * TIMESTAMP(19) 默认值[CURRENT_TIMESTAMP] 必填
     * 更新时间
     */
    @ApiModelProperty(name = "updateTime", value = "更新时间")
    private Date updateTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table id_worker
     *
     * @mbg.generated
     */
    private static final long serialVersionUID = 1L;

    /**
     * INTEGER(10) 必填
     * 获得 自增id
     */
    public Integer getWorkerId() {
        return workerId;
    }

    /**
     * INTEGER(10) 必填
     * 设置 自增id
     */
    public void setWorkerId(Integer workerId) {
        this.workerId = workerId;
    }

    /**
     * VARCHAR(63) 默认值[] 必填
     * 获得 ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * VARCHAR(63) 默认值[] 必填
     * 设置 ip
     */
    public void setIp(String ip) {
        this.ip = ip == null ? null : ip.trim();
    }

    /**
     * INTEGER(10) 默认值[-1] 必填
     * 获得 port
     */
    public Integer getPort() {
        return port;
    }

    /**
     * INTEGER(10) 默认值[-1] 必填
     * 设置 port
     */
    public void setPort(Integer port) {
        this.port = port;
    }

    /**
     * VARCHAR(127) 默认值[] 必填
     * 获得 ip:port
     */
    public String getLocalhost() {
        return localhost;
    }

    /**
     * VARCHAR(127) 默认值[] 必填
     * 设置 ip:port
     */
    public void setLocalhost(String localhost) {
        this.localhost = localhost == null ? null : localhost.trim();
    }

    /**
     * BIGINT(19) 默认值[0] 必填
     * 获得 最后一次心跳时间戳
     */
    public Long getMaxTimestamp() {
        return maxTimestamp;
    }

    /**
     * BIGINT(19) 默认值[0] 必填
     * 设置 最后一次心跳时间戳
     */
    public void setMaxTimestamp(Long maxTimestamp) {
        this.maxTimestamp = maxTimestamp;
    }

    /**
     * TIMESTAMP(19) 默认值[CURRENT_TIMESTAMP] 必填
     * 获得 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * TIMESTAMP(19) 默认值[CURRENT_TIMESTAMP] 必填
     * 设置 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * TIMESTAMP(19) 默认值[CURRENT_TIMESTAMP] 必填
     * 获得 更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * TIMESTAMP(19) 默认值[CURRENT_TIMESTAMP] 必填
     * 设置 更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table id_worker
     *
     * @mbg.generated
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", workerId=").append(workerId);
        sb.append(", ip=").append(ip);
        sb.append(", port=").append(port);
        sb.append(", localhost=").append(localhost);
        sb.append(", maxTimestamp=").append(maxTimestamp);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table id_worker
     *
     * @mbg.generated
     */
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        IdWorkerPO other = (IdWorkerPO) that;
        return (this.getWorkerId() == null ? other.getWorkerId() == null : this.getWorkerId().equals(other.getWorkerId()))
            && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
            && (this.getPort() == null ? other.getPort() == null : this.getPort().equals(other.getPort()))
            && (this.getLocalhost() == null ? other.getLocalhost() == null : this.getLocalhost().equals(other.getLocalhost()))
            && (this.getMaxTimestamp() == null ? other.getMaxTimestamp() == null : this.getMaxTimestamp().equals(other.getMaxTimestamp()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table id_worker
     *
     * @mbg.generated
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWorkerId() == null) ? 0 : getWorkerId().hashCode());
        result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
        result = prime * result + ((getPort() == null) ? 0 : getPort().hashCode());
        result = prime * result + ((getLocalhost() == null) ? 0 : getLocalhost().hashCode());
        result = prime * result + ((getMaxTimestamp() == null) ? 0 : getMaxTimestamp().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }
}